<?php

class Model_log extends Model {

    function Model_log() {
        parent::Model();
    }

    /**
     * Log page
     * @return
     * @param $iUserId Integer
     * @param $sIp String
     * @param $sActiune String
     */
    function logPage($iUserId, $sIp, $sAction, $sPost) {
        $aInsert = array("user_id" => $iUserId, "ip" => $sIp, "browser" => $this->input->user_agent(), "logdate" => date('Y-m-d H:i:s'), "action" => $sAction, "post" => $sPost);
        $this->db->insert("accesslog", $aInsert);
    }

    /**
     * Schimbare data ultimei activitati pentru user
     * @return
     * @param object $iUserId
     */
    function logLastActivity($iUserId) {
        $this->db->where("user_id", $iUserId) ;
        $this->db->set("lastactivity", date('Y-m-d H:i:s'));
        $this->db->update("user");
    }
}

/* End of file LogModel.php */
/* Location: ./system/application/models/LogModel.php */
?>